proc bot:inmessage {from type body} {
global name
set a "inmessage:"

set conf [node_from_jid "$from"]
set serv [server_from_jid "$from"]
set nick [resource_from_jid "$from"]
set text [string tolower $body]

	if {[config::optionenable all] && $type!="error"} {
		::debug $a "type<>error" "opt(all)!=0"
		::debug $a "text" "$text"
		::debug $a "conf==$conf\n\tserv==$serv\n\t" "nick==$nick"
		if {[info exists name($conf@$serv)]!=1} {
			::debug $a "name($conf@$serv)" "not exists"
			set "name($conf@$serv)" "$from"
			::debug $a "name($conf@$serv)" "is\t $name($conf@$serv)"
		}
		hook::run message "$from" "$type" "$body"
	}
}
